import axios from 'axios'
// import router from '@/router'

export function request(configUrl) {
    const instance = axios.create({
        // baseURL: "https://m.maizuo.com",
        timeout: 5000,
        headers: {
            "X-Client-Info": ' {"a":"3000","ch":"1002","v":"5.0.4","e":"1614444947506870565437441","bc":"310100"}',
        }
    })

    // 请求拦截
    instance.interceptors.request.use(config => {
        return config;
    }, err => {
        return Promise.reject(err)
    })

    // 响应拦截
    instance.interceptors.response.use(res => {
        return res;
    }, err => {
        return Promise.reject(err)
    })

    return instance(configUrl)
}